package agend.client.behaviours;

import agend.client.utils.GetAID;
import jade.core.AID;
import jade.core.behaviours.OneShotBehaviour;
import jade.lang.acl.ACLMessage;

/**
 * Behaviour che informa l'agente registration sul server
 * di registrare l'utente
 */
public class InformRegistrationBehaviour extends OneShotBehaviour {

	private static final long serialVersionUID = 1L;
	
	private String content;

	@Override
	public void action() {
		
		AID aid = GetAID.registration();
		
		ACLMessage aclMessage = new ACLMessage(ACLMessage.INFORM);
		aclMessage.setSender(myAgent.getAID());
		aclMessage.addReceiver(aid);
		aclMessage.setContent(content);
		
		myAgent.send(aclMessage);
	}

	public void setContent(String content) {
		this.content = content;
	}

}
